

 <?php
 if(empty($_POST)){
 if($_SESSION['Permit']==1)
 { 
   
	$sqlsection =sprintf("select * from tblsection ");

 } 
  $sqlsection =sprintf("select * from tblsection where id='%s'",$_GET['id']);
  $Section=mysql_query($sqlsection)or die(mysql_error());
 
  
   
?>  
  <script type="text/javascript">
  

function test(control)
  {	  
	   if(document.getElementById('parent_id').value=="")
	   {
	   alert('hay chon section');
	   return 0;
	   }
	   document.detailt.submit();
  }

  function submitt(control)
  {	  
    document.getElementById('temp').value=control.value;
	
	document.formEdit.submit();
  }
  function changevalue(control)
  {	  
     document.getElementById('url').value="article.php?id="+control.value;
  }
  </script>



     <?php if(isset($_GET['id'])) $row_CurrentLink=mysql_fetch_assoc($Section);  ?>
  
       
  <form name="detailt" action="" method="POST">
  	<table width="100%">
  		<tr>
  			<th colspan="2" style="background:#008000; height:30px; color:white;">Chính sửa chuyên mục</th>
  		</tr>
  		<tr>
  			<td width="25%" style="background:#CCC; font-weight:bold">Tên chuyên mục</td>
  			<td><input name="name" type="text"  value="<?php if(isset($_GET['id'])) echo $row_CurrentLink['name']; ?>" size="50" /></td>
  		</tr>
  		<tr>
  			<td width="25%" style="background:#CCC; font-weight:bold">Tên Tiếng Việt</td>
  			<td>
  				<textarea name="vn_name"  cols="45" rows="2" ><?php if(isset($_GET['id'])) echo $row_CurrentLink['vn_name']; ?></textarea>
         	</td>
  		</tr>
          <tr>
  			<td width="25%" style="background:#CCC; font-weight:bold">Tên Tiếng Anh</td>
  			<td>
  				<textarea name="en_name"  cols="45" rows="2" ><?php if(isset($_GET['id'])) echo $row_CurrentLink['en_name']; ?></textarea>
         		
         	</td>
  		</tr>
          <tr>
  			<td width="25%" style="background:#CCC; font-weight:bold">Mô tả</td>
  			<td>
  				<textarea name="decription"  cols="45" rows="2" ><?php if(isset($_GET['id'])) echo $row_CurrentLink['decription']; ?></textarea>
                  
         	</td>
  		</tr>
          <tr>
  			<td width="25%" style="background:#CCC; font-weight:bold">Hiện lên trang chủ</td>
  			<td>
  				<input name="tab" type="text" value="<?php if(isset($_GET['id'])) echo $row_CurrentLink['tab']; ?>" size="2" maxlength="2"/>
                  <input type="hidden" value="<?php if(isset($_GET['id'])) echo $row_CurrentLink['id']; ?>"/>
         	</td>
  		</tr>
  		<tr>
  			<td colspan="2" align="center">
  				<input type="submit" name="click" value="Lưu"/>
  				<input type="reset" value="Làm lại" />
  			</td>
  		</tr>
  	</table>
  

   
    
  </form>
  <?php
 }else{
 	include ("savesection.php");
 }
 
  ?>
